<%= stylesheet_link_tag 'bootstrap/pagination'  %>
<link href="https://cdn.bootcss.com/bootstrap-table/1.11.1/bootstrap-table.css" rel="stylesheet">
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap-table/1.11.1/bootstrap-table.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.6.0/locale/bootstrap-table-zh-CN.min.js"></script>
<table id="table"></table>
<script>
    var $table = $('#table');
    $(function () {
        $table.bootstrapTable({
            classes: "table table-bordered table-hover table-striped",
            method: 'post',
            striped: true,
            sortable: false,
            pageNumber: 1,
            pagination: true,
            pageSize: 10,
            pageList: false,
            url: '/admin/appointed_overviews/data',
            sidePagination: "server",
            columns: [
                [
                    {
                        title: '日期',
                        field: 'report_date',
                        rowspan: 2,
                        align: 'center',
                        valign: 'middle'
                    },
                    {
                        title: '集团',
                        field: 'company',
                        rowspan: 2,
                        align: 'center',
                        valign: 'middle'
                    },
                    {
                        title: '登陆/注册数',
                        field: 'member_type',
                        rowspan: 2,
                        align: 'center',
                        valign: 'middle'
                    },
                    {
                        title: '约课人数',
                        colspan: 2,
                        align: 'center',
                    },
                    {
                        title: '约课数量',
                        colspan: 2,
                        align: 'center'
                    },
                    {
                        title: '平均约课/人',
                        colspan: 2,
                        align: 'center'
                    }
                ],
                [
                    {
                        title: '免费',
                        field: 'free_appointed',
                        align: 'center'
                    },
                    {
                        title: '收费',
                        field: 'tuition_appointed',
                        align: 'center'
                    },
                    {
                        title: '免费',
                        field: 'free_course_appointed',
                        align: 'center'
                    },
                    {
                        title: '收费',
                        field: 'tuition_course_appointed',
                        align: 'center'
                    },
                    {
                        title: '免费',
                        field: 'free_avg',
                        align: 'center'
                    },
                    {
                        title: '收费',
                        field: 'tuition_avg',
                        align: 'center'
                    }
                ]
            ]
        })
    });
</script>